﻿namespace Cos.Module.Form.NHibernate.Test
{
    using System.Collections.Generic;

    using Cos.Core.NHibernate;
    using Cos.Core.NHibernate.Tests;

    using NUnit.Framework;

    [TestFixture]
    public class FormElementDataModelFixture : ModuleFixtureBase
    {
        [Test]
        public void CanMapFormElementDataModel()
        {
            new PersistenceSpecification<FormElementDataModel>(Session)
                .CheckProperty(x => x.Boolean1, true)
                .CheckProperty(x => x.Boolean1Live, true)
                .CheckProperty(x => x.Boolean2, true)
                .CheckProperty(x => x.Boolean2Live, true)
                .CheckProperty(x => x.CSS, "css")
                .CheckProperty(x => x.CssLive, "css live")
                .CheckProperty(x => x.Enum, "enum")
                .CheckProperty(x => x.EnumLive, "enum live")
                //.CheckComponentList(x => x.FormElementChoices, new List<FormElementChoiceDataModel>())
                //.CheckComponentList(x => x.FormElementCultures, new List<FormElementCultureDataModel>())
                //.CheckReference(x => x.FormId, this.Form.Id)
                //.CheckReference(x => x.FormPageId, this.FormPage.Id)
                .CheckProperty(x => x.InputType, "Text")
                .CheckProperty(x => x.IsDeleted, false)
                .CheckProperty(x => x.Long1, 1.0)
                .CheckProperty(x => x.Long1Live, 1.1)
                .CheckProperty(x => x.Long2, 2.0)
                .CheckProperty(x => x.Long2Live, 2.1)
                .CheckProperty(x => x.Long3, 3.0)
                .CheckProperty(x => x.Long3Live, 3.1)
                .CheckProperty(x => x.Long4, 4.0)
                .CheckProperty(x => x.Long4Live, 4.1)
                .CheckProperty(x => x.Name, "name")
                .CheckProperty(x => x.Ordering, 1)
                .CheckProperty(x => x.Required, true)
                .CheckProperty(x => x.RequiredLive, true)
                //.CheckComponentList(x => x.SubmissionValues, new List<SubmissionValueDataModel>())
                .CheckProperty(x => x.Text1, "text 1")
                .CheckProperty(x => x.Text1Live, "text 1 live")
                .CheckProperty(x => x.Text2, "text 2")
                .CheckProperty(x => x.Text2Live, "text 2 live")
                .VerifyTheMappings();
        }
    }
}
